﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Model
{
    public class UserConfiguration:IEntityTypeConfiguration<User>
    {
        public void Configure(EntityTypeBuilder<User> entityTypeBuilder)
        {
            entityTypeBuilder.ToTable("user");

            entityTypeBuilder.HasKey(t => t.ID);

            entityTypeBuilder.Property(t => t.ID).HasColumnName("id");
            entityTypeBuilder.Property(t => t.UserName).HasMaxLength(255).HasColumnName("username");
            entityTypeBuilder.Property(t => t.Sex).HasColumnName("sex");
            entityTypeBuilder.Property(t => t.Age).HasColumnName("age");
           
        }
    }
}
